docs(skills): SQL-first contract with 4-call ceiling for pipeline audits#4
Merged
Conversation
Bumps bundled skills to match the SQL-first contract validated in production this week. Default analytics path is now the hosted warehouse via `topline --agent query`; `pipeline audit` is demoted to diagnostic / one-off use only. skills/hermes/SKILL.md (0.2.0 -> 1.2.0): - Adds "Standard pipeline audit contract" with hard 4-call ceiling: date -> freshness SQL -> composite SQL -> answer. - Demotes `topline pipeline audit` to diagnostic/one-off, not the default for "what happened this week in pipeline X" questions. - Adds `TOPLINE_QUERY_TOKEN` (connection-bound, from https://os-mcp.topline.com/connect) as the auth surface for SQL. - Adds pitfalls: starting analytics with REST when SQL is available; running both SQL and pipeline audit "to verify"; auto-falling back to REST when SQL is partial; mislabeling SQL/native disagreements as sync lag. skills/claude-code/SKILL.md: mirrors the same contract in shorter form for Claude Code consumers.
This was referenced May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the bundled
skills/hermes/SKILL.md(0.2.0 → 1.2.0) andskills/claude-code/SKILL.mdin line with the SQL-first contract validated in production this week. Any agent that installsos-cliwill now get the same playbook our internal agents are using, instead of the older REST-first guidance.The contract change
For any "what happened in pipeline X over window W" question, the agent runs exactly:
date(only if window is custom/relative)topline --agent query sql --sql '<freshness check>'— one call coveringmessages,opportunities,call_events,appointmentstopline --agent query sql --sql '<composite audit>'— one call returning open count/value, stage rollup, activity by channel/direction, moved/created/closed deals, top active dealsHard ceiling: 4 tool calls after skills load. No
pipeline audit, noopportunities search, noconversations search, no Python verification loops.Why this matters
Last week's qualified-pipeline test ran 15+ tool calls because the previous skill said "3–5 target" (soft), told the agent to use SQL-first and verify-the-negative with
pipeline audit, and auto-fallback to REST when SQL was "fresh but incomplete". Three contradictory instructions = a thrashy agent. This PR makes the contract hard and removes the auto-fallback so warehouse coverage gaps surface asos-mcpbugs instead of getting papered over.What changed
skills/hermes/SKILL.mdv0.2.0 → v1.2.0## Standard pipeline audit contract (hard limit — 4 calls)sectiontopline pipeline auditdemoted to "diagnostic / one-off only — NOT the analytics default"TOPLINE_QUERY_TOKENdocumented (connection-bound, from https://os-mcp.topline.com/connect; raw PITs intentionally rejected for SQL)pipeline audit"to verify"; auto-falling back to REST when SQL is partial; mislabeling SQL/native disagreements as sync lagskills/claude-code/SKILL.md: mirrors the same contract in shorter form for Claude Code consumersWhat didn't change
TOPLINE_QUERY_TOKEN, which already shipped in Add hosted warehouse query commands #3.topline pipeline auditstill exists and works; only its role in the default audit flow changed.Test plan
pipeline auditcall in the default flowopportunities/conversations/messagescalls)Follow-ups (separate PRs)
Tracked in
docs/plans/2026-05-13-sql-first-retrieval-improvements.md:topline query doctor— token/base-URL/schema reachability probescripts/install-local.sh+ README — fixes the wrapper-drift footgun where installers have to hand-edit the launcher to allowlistTOPLINE_QUERY_TOKENos-mcpviews (separate repo):pipeline_activity_window,pipeline_snapshot,pipeline_movement_window,warehouse_freshness, plus updatingcontact_timelineto UNION appointments and call_events